package com.chuanke.ckfamily.service.user.thread;

import com.chuanke.ckfamily.service.user.UserService;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

public class LoadFansThread {

    private static ThreadPoolExecutor threadPool = new ThreadPoolExecutor(100, 1000, 3,
                                        TimeUnit.SECONDS, new ArrayBlockingQueue<Runnable>(500),
				new ThreadPoolExecutor.DiscardOldestPolicy());

    public static void load(UserService userService, Long uid) {
        LoadFansRunnable thread = new LoadFansRunnable(userService, uid);
        threadPool.execute(thread);
    }
}
